// 使用 pinia 的 Demo
import { defineStore } from "pinia";

const useCounterStore = defineStore("counter", {
  state: () => ({
    count: 0,
  }),
  getters: {
    doubleCount({ count }) {
      return count * 2;
    },
  },
  actions: {
    increment(step = 1) {
      this.count += step;
    },
  },
});

export default useCounterStore;
